/* Nasconde il modale all'avvio */
#video-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-content {
    position: relative;
    width: 80%;
    max-width: 800px;
    background: black;
    padding: 20px;
    border-radius: 10px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: white;
}

iframe {
    width: 100%;
    height: 450px;
}


.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    position: relative;
    cursor: pointer;
    text-align: center;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.video-thumbnail {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-overlay svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.video-title {
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

.hidden {
    display: none;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Mantiene il rapporto 16:9 */
    overflow: hidden;
    border-radius: 8px;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Assicura che l'immagine copra tutto lo spazio disponibile */
    border-radius: 8px;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #000;
    border-radius: 5px;
}

.pagination a.active {
    background-color: #0073e6;
    color: white;
    border: none;
}

.pagination a:hover {
    background-color: #005bb5;
    color: white;
}